﻿Imports Microsoft.VisualBasic

Public Interface IDataRepository(Of T As Class)
    Inherits IDisposable
    Function Fetch() As IQueryable(Of T)
    Function Todos() As IEnumerable(Of T)
    Function Buscar(predicate As Func(Of T, Boolean)) As IEnumerable(Of T)
    Function BuscarUnico(predicate As Func(Of T, Boolean)) As T
    Function BuscarPrimero(predicate As Func(Of T, Boolean)) As T
    Function BuscarUltimo(predicate As Func(Of T, Boolean)) As T
    Sub Agregar(entity As T)
    Sub Borrar(entity As T)
    Sub Adjuntar(entity As T)
    Function GuardarCambios() As Integer
    Function GuardarCambios(options As Data.Objects.SaveOptions) As Integer

End Interface